/**
 * https://leetcode-cn.com/problems/valid-anagram/
 * @param {string} s
 * @param {string} t
 * @return {boolean}
 */
 var isAnagram = function(s, t) {
  const bucket = new Array(26).fill(0);
  if (s.length !== t.length) {
      return false;
  }
  for (let i = 0; i < s.length; i++) {
      const sChar = s.charCodeAt(i);
      const tChar = t.charCodeAt(i);
      bucket[sChar - 97]++;
      bucket[tChar - 97]--;
  }
  return !bucket.some(count => count !== 0);
};
